package com.gfxy.ms.demo.chenxi;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
@RequestMapping("/Chenxi-semester")
@RestController
public class ChenxiSemesterController {
        @RequestMapping("/list")

        public List<ChenxiSemester> getSemesterList(){
            List<ChenxiSemester> result = new ArrayList<>();

            ChenxiSemester semester1 = new ChenxiSemester();
            semester1.setId("2020-2021-2");
            semester1.setName("2020-2021学年第二学期");
            semester1.setState(1);
            semester1.setStartDate("2021-03-01");
            semester1.setEndDate("2021-08-26");

            ChenxiSemester semester2 = new ChenxiSemester();
            semester2.setId("2020-2021-1");
            semester2.setName("2020-2021学年第一学期");
            semester2.setState(0);
            semester2.setStartDate("2020-08-31");
            semester2.setEndDate("2021-02-28");

            result.add(semester1);
            result.add(semester2);

            return result;
        }
}
